/**
 *  tp1
 *  Author: thuanvd_2
 *  Description: Une foret brule
Les pompier vont pour eteindre le feu
 */
 
model tp1
global {
	int width_and_height_of_environment min : 10 <- 100 ;
	int nb_tree min : 50 <- 100 ;
	int nb_pompiers min : 10 <- 20 ;
	int vitesse min : 10 <- 10 ;
	init {
		create tree number : nb_tree ;
		create pompier number: nb_pompiers;
	}
}
environment width : width_and_height_of_environment height :
width_and_height_of_environment torus : true ;
entities {
/** Insert here the definition of the species of agents */
	species name: tree skills : [ situated , visible ] {
	/*situated skill*/
	//		const range type:float init:
		point location <- point ( [ rnd ( 100 - 2 * size ) + size , rnd ( 100 - 2 *size ) + size ] ) ;
		float size <- 5.0 ;
		//		const neighbours type:list

		/*visible skill - implicitly adds the situated skill*/
		rgb color <- rgb ( 'green' ) ;
		//		const information type:string
		//		const hidden type:bool
		//		const shape type:string
		geometry shape <- circle ( size ) ;
		aspect default {
			draw geometry : shape color : color ;
		}
	}
	species name: pompier skills : [ moving ] {
	/*situated skill*/
	//		const range type:float init:
		point location<- point ( [ rnd ( 100 - 2 * size ) + size ,rnd ( 100 - 2 * size ) + size ] ) ;
		float size<- 4.0 ;
		//		const neighbours type:list

		/*visible skill - implicitly adds the situated skill*/
		rgb color <-rgb ( 'red' ) ;
		//		const information type:string
		//		const hidden type:bool
		//		const shape type:string

		/*moving skill */
		const speed type : float ;
		const heading type : int ;
		const destination type : point ;
		reflex patrolling {
			do action: wander amplitude : 180 ;
		}
		
		aspect default{
			draw geometry : shape color:color;
		}
	}
}
experiment tp1 type : gui {
	parameter 'Width and Height of Environment' var :
	width_and_height_of_environment ;
	parameter 'Number of Pompier:' var : nb_pompiers ;
	parameter 'Speed of Pompier:' var : vitesse ;
	output {
		display Forest refresh_every : 1 {
			species tree ;
			species pompier ;
		}
	}
}

//just add this comment to check 